<template>
  <div class="f-loading__mask" v-show="show">
    <div class='mb-20px f-loading__icon'>
      <div class="round1"></div>
      <div class="round2"></div>
    </div>
    <p>加载中 . . .</p>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  }
})
</script>

<style lang="less" scoped>
.f-loading {
  &__mask {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1011;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0.7;
    color: rgb(25, 137, 250);
  }

  &__icon {
    width: 40px;
    height: 40px;

    position: relative;

    .round1,
    .round2 {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background-color: rgb(25, 137, 250);
      opacity: 0.6;
      position: absolute;
      top: 0;
      left: 0;

      -webkit-animation: bounce 2.0s infinite ease-in-out;
      animation: bounce 2.0s infinite ease-in-out;
    }

    .round2 {
      -webkit-animation-delay: -1.0s;
      animation-delay: -1.0s;
    }
  }

  @-webkit-keyframes bounce {

    0%,
    100% {
      -webkit-transform: scale(0.0)
    }

    50% {
      -webkit-transform: scale(1.0)
    }
  }

  @keyframes bounce {

    0%,
    100% {
      transform: scale(0.0);
      -webkit-transform: scale(0.0);
    }

    50% {
      transform: scale(1.0);
      -webkit-transform: scale(1.0);
    }
  }
}
</style>
